package router

import (
	"github.com/gin-gonic/gin"
	"mxshop-api/order-web/api/shop_cart"
	"mxshop-api/order-web/middlewares"
)

/*
*
创建购物车的路由
*/
func InitCartRouter(Router *gin.RouterGroup) {
	//1 jwt登录鉴权 2 链路追踪
	CartRouter := Router.Group("shopcarts").Use(middlewares.JWTAuth()).Use(middlewares.Tracing())
	{
		CartRouter.GET("", shop_cart.List)          //购物车列表
		CartRouter.DELETE("/:id", shop_cart.Delete) //删除购物车
		CartRouter.POST("", shop_cart.New)          //添加到购物车
		CartRouter.PATCH("/:id", shop_cart.Update)  //删除购物车
	}
}
